package com.ddpt.platform.common.enums;

/**
 * 字段类型
 *
 */
public enum TagTypeEnum {
    /*
     *    // notes 2 禁止使用
     *      * number(0,"数字类型"),
     *      * string(1,"字符串类型"),
     *      * time(3,"时间类型"),
     *      * enumerate(4,"枚举类型")
     *      * booleanTypes(5,"布尔类型")
     */

    number(0,"数字类型"),
    string(1,"字符类型"),
    time(3,"时间类型"),
    enumerate(4,"枚举类型"),
    booleanTypes(5,"布尔类型")
    ;

    public final Integer type;

    public final String remark;

    TagTypeEnum(Integer type, String...remarks) {
        this.type = type;
        this.remark = remarks.length>0?remarks[0]:"";
    }

    public static TagTypeEnum getByType(Integer type){
        if(type == null){
            return string;
        }
        for (TagTypeEnum pe : TagTypeEnum.values()) {
            if(pe.type.equals(type)){
                return pe;
            }
        }
        return string;
    }
}
